package com.xtinno.controller;

import java.util.List;

import cn.com.apollo.platformbase.response.ResponseResult;
import com.xtinno.pojo.ResponseData;
import com.xtinno.pojo.Result;
import com.xtinno.pojo.dto.LawReasoningRequestDTO;
import com.xtinno.pojo.dto.LawReasoningResponseDTO;
import com.xtinno.service.LawReasoningService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 法条推导.
 *
 * @author lizhen
 * @since 1.0.0
 */
@Tag(name = "法条推导")
@RestController
@RequestMapping("/lawReasoning")
@RequiredArgsConstructor
public class LawReasoningController {

	@Autowired
	private final LawReasoningService lawReasoningService;

	/**
	 * 法条推导
	 */
	@PostMapping(value = "/reasoning")
	public ResponseData<LawReasoningResponseDTO> lawReasoning(@RequestBody LawReasoningRequestDTO lawReasoningRequestDTO) {
		var law = lawReasoningService.reasoning(lawReasoningRequestDTO);
		ResponseData<LawReasoningResponseDTO> responseData = new ResponseData<>();
		Result result = new Result();
		result.setCode("1");
		result.setMessage("ok.");
		responseData.setResult(result);
		responseData.setBody(law);

		return responseData;
	}

}
